*****************************************************************************************************************
*****************************************************************************************************************
****Paper: Deregulating Innovation Capital: The Effect of the JOBS Act on Biotech Startups
****Journal: Review of Corporate Finance Studies
****Authors: Craig Lewis, Josh White
****Version: November 13, 2022

/*Notes
1. There are two datasets: 
	(1) bio_firm_level.dta is a firm level dataset
		->The psudo version is labeled bio_firm_level_pseudo.dta
		
	(2) bio_drug_ind_level.dta is a drug-indicator level dataset. 
		->The psudo version is labeled bio_drug_ind_level_pseudo.dta

2. You may need to install these in Stata
	ssc install reghdfe, replace
	ssc install ftools, replace
	ssc install estout, replace

3. See manuscript for data sources
*/
*****************************************************************************************************************
*****************************************************************************************************************

*****************************************************************************************************************
*Identify file location
set linesize 80
clear
capture cd "E:\Data\Bio\RCFS\"
*****************************************************************************************************************

*****************************************************************************************************************
*Table 1 - Industry distribution
*****************************************************************************************************************

***********************************************
*T1 Firm level
***********************************************
use bio_firm_level, clear

*1A - Biotech company type
tab2 drug post_jobs

*1B - Thereapeutic target
tab2 Therapeutic_Target post_jobs

*1E - Stage by company type
tab2 Stage post_jobs if(drug==0)	/* Nondrug companies */
tab2 Stage post_jobs if(drug==1)	/* Drug companies */


***********************************************
*T1 Drug-Indicator level
***********************************************
use bio_drug_ind_level.dta, clear

*1C - Thereapeutic target
tab2 bmt_diseasegroup post_jobs

*1D - FDA designations 
tab2 rare_disease post_jobs
tab2 orphan_drug_ipo post_jobs
tab2 fda_fast_trac_ipo post_jobs
tab2 breakthrough_ipo post_jobs

*1F - FDA Phase 
tab2 fda_phase_ipo post_jobs


*****************************************************************************************************************
*Table 2 - Summary Stats		
*****************************************************************************************************************
use bio_firm_level, clear
foreach var of varlist sale zero_rev sales ebitda_at op_loss xrd rd_at lev che cash liq at size ppeg ln_pat_us ln_patapp_us age ln_uwrep und_spread spread_diff sh_sec_pct sh_sec_ind nasdaq {
	ttest `var',by(post_jobs)
	reghdfe `var' post_jobs, a(state target)
}


*****************************************************************************************************************
*Table 3 - Use of Proceeds
*****************************************************************************************************************
use bio_firm_level, clear

*Columns 1-2 (% itemized) 
tabstat alloc_rd alloc_pc alloc_ct alloc_fda alloc_mfr alloc_comm alloc_repay alloc_gen, by(post_jobs)

*Columns 3-4 (average anticipated spend billions of dollars)
tabstat uop_rd_tot uop_pc_tot uop_ct_tot uop_fda_tot uop_mfr_tot uop_comm_tot uop_repay_tot uop_gen_tot uop_net_tot, by(post_jobs)

*Columns 5-6 (average percent of proceeds)
tabstat uop_rd_pct_pro uop_pc_pct_pro uop_ct_pct_pro uop_fda_pct_pro uop_mfr_pct_pro uop_comm_pct_pro uop_repay_pct_pro uop_gen_pct_pro, by(post_jobs)

*Columns 7-8 (average percent of post-IPO cash)
tabstat uop_rd_pct_cash uop_pc_pct_cash uop_ct_pct_cash uop_fda_pct_cash uop_mfr_pct_cash uop_comm_pct_cash uop_repay_pct_cash uop_gen_pct_cash, by(post_jobs)


*****************************************************************************************************************
*Table 4 - Outcomes at IPO Stage
*****************************************************************************************************************

***********************************************
*4A Summary Stats
***********************************************

*Firm level
use bio_firm_level, clear
tabstat ipo_proceeds ln_ipo_proceeds stage_num_guo, stat(mean sd) by(post_jobs) col(stat)long

*Drug-Indicator level
use bio_drug_ind_level.dta, clear
tabstat fda_adjphase_ipo loa_ipo cancer_drug  rare_disease orphan_drug_ipo fda_fast_trac_ipo, stat(mean sd) by(post_jobs) col(stat)long

***********************************************
*4B Regressions
***********************************************
use bio_firm_level, clear	/*Columns 1-2*/
est clear
eststo: xi: reghdfe ln_ipo_proceeds   post_jobs drug max_rare_disease max_orphan_drug_ipo max_fda_fast_trac_ipo max_breakthrough_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state target) cl(sicp)
eststo: xi: reghdfe stage_num_guo     post_jobs      max_rare_disease max_orphan_drug_ipo max_fda_fast_trac_ipo max_breakthrough_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state target) cl(sicp)

use bio_drug_ind_level.dta, clear	/*Columns 3-8*/
eststo: xi: reghdfe fda_adjphase_ipo  post_jobs      rare_disease     orphan_drug_ipo     fda_fast_trac_ipo     breakthrough_ipo     ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state bmt_diseasegroup) cl(sicp)
eststo: xi: reghdfe loa_ipo           post_jobs      rare_disease     orphan_drug_ipo     fda_fast_trac_ipo     breakthrough_ipo     ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state bmt_diseasegroup) cl(sicp)
eststo: xi: reghdfe cancer_drug       post_jobs      rare_disease     orphan_drug_ipo     fda_fast_trac_ipo     breakthrough_ipo     ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state fda_phase_ipo) cl(sicp)
eststo: xi: reghdfe rare_disease      post_jobs                       orphan_drug_ipo     fda_fast_trac_ipo     breakthrough_ipo     ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state fda_phase_ipo) cl(sicp)
eststo: xi: reghdfe orphan_drug_ipo   post_jobs      rare_disease                         fda_fast_trac_ipo     breakthrough_ipo     ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state fda_phase_ipo) cl(sicp)
eststo: xi: reghdfe fda_fast_trac_ipo post_jobs      rare_disease     orphan_drug_ipo                           breakthrough_ipo     ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state bmt_diseasegroup fda_phase_ipo) cluster(sicp)


*****************************************************************************************************************
*Table 5 - Post IPO Product Development
*****************************************************************************************************************

***********************************************
*5A Summary Stats
***********************************************
*Drug-Indicator Level
use bio_drug_ind_level.dta, clear
tabstat num_patent_event_p12 num_patent_event_p24 num_fda_ind_event_p12 num_fda_ind_event_p24  num_trial_initiate_event_p12 num_trial_initiate_event_p24 trials_p12 trials_p24 num_trialevents_p12 num_trialevents_p24 patients_ipo_p12 patients_ipo_p24, stat(mean sd) by(post_jobs) col(stat)long

*Firm Level
use bio_firm_level, clear
tabstat ch_emp_p1 ch_emp_p2, stat(mean sd) by(post_jobs) col(stat)long
 
***********************************************
*5B Regressions - 1year
***********************************************
use bio_drug_ind_level.dta, clear   /*Columns 1-6*/
est clear
eststo: xi: reghdfe num_patent_event_p12  			post_jobs rare_disease breakthrough orphan_drug_ipo fda_fast_trac_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state bmt_diseasegroup fda_phase_ipo) cl(sicp)
eststo: xi: reghdfe num_fda_ind_event_p12 			post_jobs rare_disease breakthrough orphan_drug_ipo fda_fast_trac_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state bmt_diseasegroup fda_phase_ipo) cl(sicp)
eststo: xi: reghdfe num_trial_initiate_event_p12  	post_jobs rare_disease breakthrough orphan_drug_ipo fda_fast_trac_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state bmt_diseasegroup fda_phase_ipo) cl(sicp)
eststo: xi: reghdfe trials_p12  					post_jobs rare_disease breakthrough orphan_drug_ipo fda_fast_trac_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state bmt_diseasegroup fda_phase_ipo) cl(sicp)
eststo: xi: reghdfe num_trialevents_p12  			post_jobs rare_disease breakthrough orphan_drug_ipo fda_fast_trac_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state bmt_diseasegroup fda_phase_ipo) cl(sicp)
eststo: xi: reghdfe patients_ipo_p12  				post_jobs rare_disease breakthrough orphan_drug_ipo fda_fast_trac_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state bmt_diseasegroup fda_phase_ipo) cl(sicp)

use bio_firm_level, clear		/*Column 7*/
eststo: xi: reghdfe ch_emp_p1  						post_jobs max_rare_disease max_orphan_drug_ipo max_fda_fast_trac_ipo max_breakthrough_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state target stage_num_guo) cl(sicp)


***********************************************
*5C Regressions - 2year
***********************************************
use bio_drug_ind_level.dta, clear	/*Columns 1-6*/
est clear
eststo: xi: reghdfe num_patent_event_p24  			post_jobs rare_disease breakthrough orphan_drug_ipo fda_fast_trac_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state bmt_diseasegroup fda_phase_ipo) cl(sicp)
eststo: xi: reghdfe num_fda_ind_event_p24 			post_jobs rare_disease breakthrough orphan_drug_ipo fda_fast_trac_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state bmt_diseasegroup fda_phase_ipo) cl(sicp)
eststo: xi: reghdfe num_trial_initiate_event_p24  	post_jobs rare_disease breakthrough orphan_drug_ipo fda_fast_trac_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state bmt_diseasegroup fda_phase_ipo) cl(sicp)
eststo: xi: reghdfe trials_p24  					post_jobs rare_disease breakthrough orphan_drug_ipo fda_fast_trac_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state bmt_diseasegroup fda_phase_ipo) cl(sicp)
eststo: xi: reghdfe num_trialevents_p24  			post_jobs rare_disease breakthrough orphan_drug_ipo fda_fast_trac_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state bmt_diseasegroup fda_phase_ipo) cl(sicp)
eststo: xi: reghdfe patients_ipo_p24  				post_jobs rare_disease breakthrough orphan_drug_ipo fda_fast_trac_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state bmt_diseasegroup fda_phase_ipo) cl(sicp)

use bio_firm_level, clear		/*Column 7*/
eststo: xi: reghdfe ch_emp_p2  						post_jobs max_rare_disease max_orphan_drug_ipo max_fda_fast_trac_ipo max_breakthrough_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state target stage_num_guo) cl(sicp)


*****************************************************************************************************************
*Table 6 - Post IPO Development Outcomes
*****************************************************************************************************************

***********************************************
*6A Summary Stats
***********************************************
use bio_drug_ind_level.dta, clear
tabstat num_trial_complete_event_p12 num_trial_complete_event_p24  bmt_suspended_ipo_p12 bmt_suspended_ipo_p24 ch_loa_ipo_p12 ch_loa_ipo_p24 ch_fda_adjphase_p12 ch_fda_adjphase_p24 num_fda_approve_event_p12 num_fda_approve_event_p24 num_fda_crl_event_p12 num_fda_crl_event_p24, stat(mean sd) by(post_jobs) col(stat)long
 
***********************************************
*6B Regressions - 1year
***********************************************
use bio_drug_ind_level.dta, clear	
est clear
eststo: xi: reghdfe num_trial_complete_event_p12 post_jobs rare_disease breakthrough orphan_drug_ipo fda_fast_trac_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state bmt_diseasegroup fda_phase_ipo) cl(sicp)
eststo: xi: reghdfe bmt_suspended_ipo_p12        post_jobs rare_disease breakthrough orphan_drug_ipo fda_fast_trac_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state bmt_diseasegroup fda_phase_ipo) cl(sicp)
eststo: xi: reghdfe ch_loa_ipo_p12               post_jobs rare_disease breakthrough orphan_drug_ipo fda_fast_trac_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state bmt_diseasegroup fda_phase_ipo) cl(sicp)
eststo: xi: reghdfe ch_fda_adjphase_p12          post_jobs rare_disease breakthrough orphan_drug_ipo fda_fast_trac_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state bmt_diseasegroup fda_phase_ipo) cl(sicp)
eststo: xi: reghdfe num_fda_approve_event_p12    post_jobs rare_disease breakthrough orphan_drug_ipo fda_fast_trac_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state bmt_diseasegroup fda_phase_ipo) cl(sicp)
eststo: xi: reghdfe num_fda_crl_event_p12        post_jobs rare_disease breakthrough orphan_drug_ipo fda_fast_trac_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state bmt_diseasegroup fda_phase_ipo) cl(sicp)

***********************************************
*6C Regressions - 2year
***********************************************
use bio_drug_ind_level.dta, clear
est clear
eststo: xi: reghdfe num_trial_complete_event_p24 post_jobs rare_disease breakthrough orphan_drug_ipo fda_fast_trac_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state bmt_diseasegroup fda_phase_ipo) cl(sicp)
eststo: xi: reghdfe bmt_suspended_ipo_p24        post_jobs rare_disease breakthrough orphan_drug_ipo fda_fast_trac_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state bmt_diseasegroup fda_phase_ipo) cl(sicp)
eststo: xi: reghdfe ch_loa_ipo_p24               post_jobs rare_disease breakthrough orphan_drug_ipo fda_fast_trac_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state bmt_diseasegroup fda_phase_ipo) cl(sicp)
eststo: xi: reghdfe ch_fda_adjphase_p24          post_jobs rare_disease breakthrough orphan_drug_ipo fda_fast_trac_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state bmt_diseasegroup fda_phase_ipo) cl(sicp)
eststo: xi: reghdfe num_fda_approve_event_p24    post_jobs rare_disease breakthrough orphan_drug_ipo fda_fast_trac_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state bmt_diseasegroup fda_phase_ipo) cl(sicp)
eststo: xi: reghdfe num_fda_crl_event_p24        post_jobs rare_disease breakthrough orphan_drug_ipo fda_fast_trac_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state bmt_diseasegroup fda_phase_ipo) cl(sicp)


*****************************************************************************************************************
*Table 7 - Robustness Tests
*****************************************************************************************************************

***********************************************
*7A Timing of results
***********************************************
use bio_firm_level, clear			/*Columns 1-2*/
est clear
eststo: xi: reghdfe ln_ipo_proceeds              jobs_m2 jobs_m1 jobs_0 jobs_p1 jobs_p2 jobs_p3 jobs_p4p drug max_rare_disease max_orphan_drug_ipo max_fda_fast_trac_ipo max_breakthrough_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state target) cl(sicp)
eststo: xi: reghdfe stage_num_guo                jobs_m2 jobs_m1 jobs_0 jobs_p1 jobs_p2 jobs_p3 jobs_p4p      max_rare_disease max_orphan_drug_ipo max_fda_fast_trac_ipo max_breakthrough_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state target) cl(sicp)

use bio_drug_ind_level.dta, clear	/*Columns 3-6*/
eststo: xi: reghdfe num_trial_initiate_event_p12 jobs_m2 jobs_m1 jobs_0 jobs_p1 jobs_p2 jobs_p3 jobs_p4p rare_disease breakthrough orphan_drug_ipo fda_fast_trac_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state bmt_diseasegroup fda_phase_ipo) cl(sicp)
eststo: xi: reghdfe trials_p12                   jobs_m2 jobs_m1 jobs_0 jobs_p1 jobs_p2 jobs_p3 jobs_p4p rare_disease breakthrough orphan_drug_ipo fda_fast_trac_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state bmt_diseasegroup fda_phase_ipo) cl(sicp)
eststo: xi: reghdfe ch_fda_adjphase_p12          jobs_m2 jobs_m1 jobs_0 jobs_p1 jobs_p2 jobs_p3 jobs_p4p rare_disease breakthrough orphan_drug_ipo fda_fast_trac_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state bmt_diseasegroup fda_phase_ipo) cl(sicp)
eststo: xi: reghdfe num_fda_approve_event_p12    jobs_m2 jobs_m1 jobs_0 jobs_p1 jobs_p2 jobs_p3 jobs_p4p rare_disease breakthrough orphan_drug_ipo fda_fast_trac_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state bmt_diseasegroup fda_phase_ipo) cl(sicp)


***********************************************
*7B Entropy Balancing  
***********************************************
/*
Note: Variables ebal_firm and ebal_drugind are entropy balanced weights 
	created using the program ebalance (ssc install ebalance, replace)
*/

use bio_firm_level, clear			/*Columns 1-2*/
est clear
eststo: xi: reghdfe ln_ipo_proceeds               	post_jobs drug max_rare_disease max_orphan_drug_ipo max_fda_fast_trac_ipo max_breakthrough_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age [pweight= ebal_firm], a(state target) cl(sicp)
eststo: xi: reghdfe stage_num_guo                 	post_jobs max_rare_disease max_orphan_drug_ipo max_fda_fast_trac_ipo max_breakthrough_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age [pweight= ebal_firm], a(state target) cl(sicp)

use bio_drug_ind_level.dta, clear	/*Columns 3-6*/
eststo: xi: reghdfe num_trial_initiate_event_p12  	post_jobs rare_disease breakthrough orphan_drug_ipo fda_fast_trac_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age [pweight= ebal_drugind], a(state bmt_diseasegroup fda_phase_ipo) cl(sicp)
eststo: xi: reghdfe trials_p12 						post_jobs rare_disease breakthrough orphan_drug_ipo fda_fast_trac_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age [pweight= ebal_drugind], a(state bmt_diseasegroup fda_phase_ipo) cl(sicp)
eststo: xi: reghdfe ch_fda_adjphase_p12 			post_jobs rare_disease breakthrough orphan_drug_ipo fda_fast_trac_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age [pweight= ebal_drugind], a(state bmt_diseasegroup fda_phase_ipo) cl(sicp)
eststo: xi: reghdfe num_fda_approve_event_p12 		post_jobs rare_disease breakthrough orphan_drug_ipo fda_fast_trac_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age [pweight= ebal_drugind], a(state bmt_diseasegroup fda_phase_ipo) cl(sicp)


*****************************************************************************************************************
*Table 8 - Long-Term Survival Analysis
*****************************************************************************************************************

***********************************************
*8A Summary Stats 
***********************************************
/*
Note: Each of these variabes are indicators that equal 1 if the event
	happens within the 12- or 24-month period after the IPO
*/

use bio_firm_level, clear
foreach num of numlist 12 24 {
	tab2 ind_liq_ch7_ch11_`num' post_jobs
	tab2 ind_name_`num' post_jobs
	tab2 ind_delist_no_bk_`num' post_jobs
	tab2 ind_listed_`num' post_jobs
	tab2 ind_merge_`num' post_jobs
	tab2 ind_acq_`num' post_jobs
}


***********************************************
*8B Hazard  regressions (hazard)
***********************************************
/*
Note: For drugs only in regression 3, drop the control for "drug" 
	and add "stage_num_guo" as FE). Also, ca_ma indicator is HQ state
	FE for this set of regressions.
*/

use bio_firm_level, clear
stset fail_date, failure(fail==1) origin(time ipo_date) scale(365.25)
est clear
eststo: stcox post_jobs      max_rare_disease max_orphan_drug_ipo max_fda_fast_trac_ipo max_breakthrough_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age i.target i.ca_ma
eststo: stcox post_jobs drug max_rare_disease max_orphan_drug_ipo max_fda_fast_trac_ipo max_breakthrough_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age i.target i.ca_ma
eststo: stcox post_jobs      max_rare_disease max_orphan_drug_ipo max_fda_fast_trac_ipo max_breakthrough_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age i.target i.ca_ma i.stage_num_guo 


*****************************************************************************************************************
*Table 9 - First Day and Buy and Hold Returns
*****************************************************************************************************************

***********************************************
*9A Summary Stats
***********************************************
use bio_firm_level, clear
tabstat underpricing bhr12 bhar12_ew bhar12_vw bhr24 bhar24_ew bhar24_vw, stat(mean sd) by(post_jobs) col(stat)long

***********************************************
*9B Regressions   
***********************************************
use bio_firm_level, clear
est clear
eststo: xi: reghdfe underpricing post_jobs drug max_rare_disease max_orphan_drug_ipo max_fda_fast_trac_ipo max_breakthrough_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state target) cl(sicp)
eststo: xi: reghdfe bhr12        post_jobs drug max_rare_disease max_orphan_drug_ipo max_fda_fast_trac_ipo max_breakthrough_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state target) cl(sicp)
eststo: xi: reghdfe bhar12_ew    post_jobs drug max_rare_disease max_orphan_drug_ipo max_fda_fast_trac_ipo max_breakthrough_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state target) cl(sicp)
eststo: xi: reghdfe bhar12_vw    post_jobs drug max_rare_disease max_orphan_drug_ipo max_fda_fast_trac_ipo max_breakthrough_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state target) cl(sicp)
eststo: xi: reghdfe bhr24        post_jobs drug max_rare_disease max_orphan_drug_ipo max_fda_fast_trac_ipo max_breakthrough_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state target) cl(sicp)
eststo: xi: reghdfe bhar24_ew    post_jobs drug max_rare_disease max_orphan_drug_ipo max_fda_fast_trac_ipo max_breakthrough_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state target) cl(sicp)
eststo: xi: reghdfe bhar24_vw    post_jobs drug max_rare_disease max_orphan_drug_ipo max_fda_fast_trac_ipo max_breakthrough_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age, a(state target) cl(sicp)

*****************************************************************************************************************
*Table 10 - Restatments and ICFR
*****************************************************************************************************************

***********************************************
*10A - Summary Stats
***********************************************
use bio_firm_level, clear
tabstat  restate_24 restate_36 MICFR24 MICFR36 AICFR24 AICFR36 if afees_audit~=. & afees_nonaudit~=., stat(mean sd) by(post_jobs) col(stat)long

***********************************************
*10B - Regressions
***********************************************
use bio_firm_level, clear
est clear
eststo: xi: reghdfe restate_24 post_jobs drug max_rare_disease max_orphan_drug_ipo max_fda_fast_trac_ipo max_breakthrough_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age afees_audit afees_nonaudit, a(target state) cl(sicp)
eststo: xi: reghdfe restate_36 post_jobs drug max_rare_disease max_orphan_drug_ipo max_fda_fast_trac_ipo max_breakthrough_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age afees_audit afees_nonaudit, a(target state) cl(sicp)
eststo: xi: reghdfe MICFR24    post_jobs drug max_rare_disease max_orphan_drug_ipo max_fda_fast_trac_ipo max_breakthrough_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age afees_audit afees_nonaudit, a(target state) cl(sicp)
eststo: xi: reghdfe MICFR36    post_jobs drug max_rare_disease max_orphan_drug_ipo max_fda_fast_trac_ipo max_breakthrough_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age afees_audit afees_nonaudit, a(target state) cl(sicp)
eststo: xi: reghdfe AICFR24    post_jobs drug max_rare_disease max_orphan_drug_ipo max_fda_fast_trac_ipo max_breakthrough_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age afees_audit afees_nonaudit, a(target state) cl(sicp)
eststo: xi: reghdfe AICFR36    post_jobs drug max_rare_disease max_orphan_drug_ipo max_fda_fast_trac_ipo max_breakthrough_ipo ln_uwrep spread_diff sh_sec_ind nasdaq size sales op_loss ebitda_at cash liq rd_at lev ppeg ln_pat_us ln_patapp_us age afees_audit afees_nonaudit, a(target state) cl(sicp)


*****************************************************************************************************************
*****************************************************************************************************************

